package com.mk.graphql.resolver;

import com.mk.graphql.entity.Author;
import com.mk.graphql.repository.Repository;
import graphql.kickstart.tools.GraphQLQueryResolver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class AuthorQuery implements GraphQLQueryResolver {

    @Autowired
    private Repository repository;

    public Author findAllAuthor(Long id) {
        return repository.get(id);
    }
}
